package com.xc.filter;

import javax.servlet.*;
import java.io.IOException;

//@WebFilter(urlPatterns = "/*")
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("创建了一个拦截器MyFilter。。。。。。。。。。。。。。。。。。。。。。。。。。。");
        //Filter.super.init(filterConfig);
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("MyFilter拦截器拦截一个请求。。。。。。。。。。。。。。。。");
        //filterChain.doFilter(servletRequest,servletResponse);
        System.out.println("MyFilter将内容放行了");
    }

    @Override
    public void destroy() {
        System.out.println("MyFilter拦截器嘎了。。。。。。。。。。。。。。。");
    }
}
